from typing import *


class Solution:

    def isWinner(self, player1: List[int], player2: List[int]) -> int:
        a, b = sum(player1), sum(player2)
        for i in range(len(player1)):
            if i - 1 >= 0 and player1[i - 1] == 10 or i - 2 >= 0 and player1[
                    i - 2] == 10:
                a += player1[i]
            if i - 1 >= 0 and player2[i - 1] == 10 or i - 2 >= 0 and player2[
                    i - 2] == 10:
                b += player2[i]
        print(a, b)
        return 0 if a == b else 1 if a > b else 2


s = Solution()
print(s.isWinner([10, 2, 2, 3], [3, 8, 4, 5]))
